
package com.rx.mgt.service;  

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rx.mgt.dao.SysLogDao;
import com.rx.mgt.domain.ScheduleTask;
import com.rx.mgt.domain.SysLog;
import com.rx.mgt.po.UsersBo;
import com.rx.mgt.util.DateUtil;

/** 
 * ClassName:SysLogService 
 * Function :
 * Reason   : 
 * Date     :Feb 6, 2017 3:01:39 PM 
 * @author   luolei 
 * @since    JDK 1.6
 */
@Service
public class SysLogService {
    @Autowired
    SysLogDao sysLogDao;
    @Transactional
    public List getAllLog(UsersBo usersBo){
        return sysLogDao.getAllLog(usersBo);
    }
    @Transactional
    public void delete(Long id){
       SysLog sysLog = sysLogDao.get(id);
        if(sysLog!=null){
            sysLogDao.delete(sysLog);
        }
   }
    @Transactional
    public void add(String content,String ip,String type,String user_id,String user_name){
        SysLog  sysLog =new SysLog();
        sysLog.setContent(content);
        sysLog.setDate(DateUtil.nowTimeString());
        sysLog.setIp(ip);
        sysLog.setType(type);
        sysLog.setUser_id(user_id);
        sysLog.setUser_name(user_name);
        sysLogDao.save(sysLog);
    }
    
}
  